import React from 'react'
import { Icon } from 'gantd'
import { booleanEmoji } from '@/utils/utils'
import UnitDomanSelector from '../unitDomanSelector/index'

export const columns = [
	{
		title: tr('名称'),
		width: 140,
		fieldName: 'name',
		cellRenderer: 'gantGroupCellRenderer'
	},
	{
		title: tr('英文名'),
		width: 140,
		fieldName: 'nameEn'
	},
	{
		title: tr('领域'),
		width: 200,
		fieldName: 'domain'
	},
	{
		title: tr('符号'),
		width: 100,
		fieldName: 'symbol'
	},
	{
		title: tr('系统单位'),
		width: 100,
		fieldName: 'isSystemUnit',
		valueFormatter: (params: any) => {
			return booleanEmoji(params.value)
		  },
	}

]

export const customComponents = [
	{
	  name: "UnitDomanSelector",
	  component: UnitDomanSelector,
	}
  ]

export const searchFormschema = {
	domain: {
		title: tr('领域'),
		componentType: "UnitDomanSelector"
	},
	name: {
		title: tr('名称'),
	},
	nameEn: {
		title: tr('英文名')
	},
	symbol: {
		title: tr('符号'),
	}
}

export const searchUISchema = {
	"ui:col": 8
}
